
package data;

import java.sql.*;
/**
 *
 * @author Alejandro
 */
public class IniciarBitacorasGateway {

    private Connection conexion;

    public IniciarBitacorasGateway(){
        Conector conector = new Conector();
        conexion = conector.darConexion();
        Statement stmt;
        try {
            stmt = conexion.createStatement();
            stmt.execute("use be");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
    
    public void crearBitacora(String ID, String cedProf){
        Statement stmt; 
        try {      
            stmt = conexion.createStatement();
            stmt.execute("Insert into Bitacora (codigoBitacora, cedulaProfesor) values (\'"+ID+"\', \'"+cedProf+"\')");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
    
    public void crearProfesor(String cedula) {
        Statement stmt; 
        try {      
            stmt = conexion.createStatement();
            stmt.execute("Insert into Profesor (cedula) values (\'"+cedula+"\')");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
